using Microsoft.EntityFrameworkCore;
using Redis_demo.Entities;
using Redis_demo.EntityConfigs;

namespace Redis_demo;


public class UserDbContext : DbContext
{
    public UserDbContext(DbContextOptions<UserDbContext> options) : base(options)
    {
    }

    public DbSet<User> Users { get; set; } // 示例实体集合
    public DbSet<Shop> Shops { get; set; } // 示例实体集合
    protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
    {
        base.OnConfiguring(optionsBuilder);
    }
    protected override void OnModelCreating(ModelBuilder modelBuilder)
    {
         base.OnModelCreating(modelBuilder);
         modelBuilder.ApplyConfigurationsFromAssembly(typeof(UserEntityConfig).Assembly); // 其他项目下的配置文件
    }
}

